package com.aizuda.boot.modules.business.contract.entity;

import com.aizuda.boot.modules.common.constant.enums.BranchJoinTypeEnum;
import com.aizuda.boot.modules.common.constant.enums.NodeTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 审批节点实体类
 *
 * @Author sangyirong
 * @Version 1.0
 * @Date 2025/5/20 13:36
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("workflow_node")
public class WorkflowNodeEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "节点ID")
    private   Integer id;

    @Schema(description = "所属审批流ID")
    private Integer workflowId;

    @Schema(description = "节点类型")
    private NodeTypeEnum nodeType;

    @Schema(description = "节点名称")
    private String nodeName;

    @Schema(description = "节点描述")
    private String description;

    @Schema(description = "分支ID（UUID），用于标识并行分支")
    private String branchId;

    @Schema(description = "在同一个分支内的顺序，或者主流程中的顺序")
    private Integer orderNum;

    @Schema(description = "是否是分支的起始节点")
    private Boolean isBranchStart;

    @Schema(description = "分支汇聚类型：ALL_COMPLETED-所有分支完成（并行审批），ORDER_COMPLETED-任意分支完成（顺序审批）")
    private BranchJoinTypeEnum branchJoinType;

    @Schema(description = "创建时间")
    private Date createdAt;

    @Schema(description = "更新时间")
    private Date updatedAt;

    @Schema(description = "删除标识（0：否[默认]，1：是）")
    @TableLogic
    private Boolean isDeleted;
} 